//
//  RecomendScreen.m
//  Gekko
//
//  Created by jose on 30/06/13.
//  Copyright (c) 2013 Jose Luis Lopez. All rights reserved.
//

#import "RecomendScreen.h"

@interface RecomendScreen ()

@end

@implementation RecomendScreen

@synthesize labelEmail,labelPlaceholder,labelTitle,buttonSend,inputEmail,inputMessage;

- (void)viewDidLoad
{
    [super viewDidLoad];

    [labelTitle setText:NSLocalizedString(@"RECOMEND", nil)];
    [labelTitle setFont:[UIFont fontWithName:kFontBold size:26]];
    
    [labelEmail setText:NSLocalizedString(@"E EMAIL", nil)];
    [labelEmail setFont:[UIFont fontWithName:kFontBold size:16]];
    
    [labelPlaceholder setText:NSLocalizedString(@"R PLA MESSAGE", nil)];
    [labelPlaceholder setFont:[UIFont fontWithName:kFontLight size:16]];
    
    [inputEmail setFont:[UIFont fontWithName:kFontLight size:16]];
    [inputEmail setPlaceholder:NSLocalizedString(@"R PLA EMAIL", nil)];
    
    [inputMessage setFont:[UIFont fontWithName:kFontLight size:16]];
   
    [buttonSend setTitle:NSLocalizedString(@"SEND", nil) forState:UIControlStateNormal];
    [buttonSend.titleLabel setFont:[UIFont fontWithName:kFontBold size:16]];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
    tap.numberOfTapsRequired = 1;
    [self.view addGestureRecognizer:tap];
}


- (IBAction)backPressed:(UIButton *)sender {

    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)sendPressed:(UIButton *)sender {
    
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"OK", nil), nil];
    if ([inputMessage.text length] == 0 && [inputEmail.text length] == 0)
        [alert setMessage:NSLocalizedString(@"RR EMPTY", nil)];

    if (NO) {
        // Text and delegate
    }
    
    
    [alert show];
}

-(void)textViewDidBeginEditing:(UITextView *)textView {
    
    [labelPlaceholder setHidden:YES];
}

-(void)hideKeyboard {
    
    NSLog(@"Tapped");
    [inputEmail resignFirstResponder];
    [inputMessage resignFirstResponder];
}

@end
